package com.todo.reward.infrastructure.repository;

import com.todo.common.common.entity.response.page.PageResult;
import com.todo.reward.infrastructure.entity.condition.RewardTemplateCondition;
import com.todo.reward.infrastructure.entity.domain.BaseTemplateDO;
import com.todo.reward.infrastructure.entity.domain.CouponExtensionDO;
import com.todo.reward.infrastructure.entity.domain.GrowthExtensionDO;
import com.todo.reward.infrastructure.entity.domain.PointsExtensionDO;

/**
 * @author azhebuxing
 * @date 2025/2/12 22:10
 * @description
 */
public interface RewardTemplateRepository {

    /**
     * 新增奖励模板
     *
     * @param baseTemplate
     * @param <T>
     */
    <T> Boolean insertRewardTemplate(BaseTemplateDO<T> baseTemplate);

    /**
     * 更新奖励模板
     *
     * @param baseTemplate
     * @param <T>
     * @return
     */
    <T> Boolean updateRewardTemplate(BaseTemplateDO<T> baseTemplate);

    /**
     * 根据模板id删除奖励模板
     *
     * @param templateId
     * @return
     */
    Boolean removeRewardTemplateById(Long templateId);

    /**
     * 根据模板id查询奖励模板
     *
     * @param templateId
     * @param <T>
     * @return
     */
    <T> BaseTemplateDO<T> queryRewardTemplateById(Long templateId);

    /**
     * 多条件查询奖励模板
     *
     * @param condition
     * @return
     */
    PageResult<BaseTemplateDO<PointsExtensionDO>> queryPointsRewardTemplateByCondition(RewardTemplateCondition condition);
    PageResult<BaseTemplateDO<GrowthExtensionDO>> queryGrowthRewardTemplateByCondition(RewardTemplateCondition condition);
    PageResult<BaseTemplateDO<CouponExtensionDO>> queryCouponRewardTemplateByCondition(RewardTemplateCondition condition);
}
